package leecode

//反转链表

type listNode struct {
	Var  int
	Next *listNode
}

func reverseList(head *listNode) (result *listNode) {
	temp := head
	for temp != nil {
		next := temp.Next
		temp.Next = result
		result = temp
		temp = next
	}
	return
}
